﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.IO;
using MvcEngine.Core.Validation;

namespace MvcEngine.Mvc.UI
{
    public static class UIExtensions
    {
        public static FormView<TModel> FormView<TModel>(this HtmlHelper helper, TModel model)
            where TModel : class
        {
            return new FormView<TModel>(model, helper.ViewContext.HttpContext.Response.Output, helper.ViewContext);
        }

        public static FormView<object> FormView(this HtmlHelper helper)
        {
            return new FormView<object>(null, helper.ViewContext.HttpContext.Response.Output, helper.ViewContext);
        }
    }
}
